package com.gxa.controller;
import com.gxa.common.LayR;
import com.gxa.common.R;
import com.gxa.param.MyTableParam;
import com.gxa.service.CustomerCreditService;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;


@Controller
@RequestMapping("/customer/credit")
public class CustomerCreditController {


    @Autowired
    private CustomerCreditService service;

        @GetMapping("/list/page")
        public String list(){
            return "customer/customer-credit-list";
        }

        /**
         * 列表数据
         * @return
         */
        @PostMapping("/list/data")
        @ResponseBody
        public LayR  listData(MyTableParam param){
            return service.list(param);
        }
        public LayR getAll(){
        return service.findAll();
    }



    @GetMapping("/record/page")
    public String recordPage(Integer customerId, Model model, HttpSession session){
        session.setAttribute("recordCustomerId",customerId);
        model.addAttribute("id", customerId);
        return "customer/customer-credit-record";
    }










}
